package com.kclm.ssm.controller;

import com.kclm.ssm.pojo.Clazz;
import com.kclm.ssm.response.Result;
import com.kclm.ssm.service.ClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author : lvhx
 * @Date: 2025/11/11 15:21
 * @Description:
 */
@RestController
@RequestMapping("/clazz")
public class ClazzController {
    @Autowired
    private ClazzService clazzService;
    @RequestMapping
    public Result findAll(){
        try {
            List<Clazz> clazzes = clazzService.findAll();
            return  Result.success("查询成功",clazzes);
        }catch (Exception e){
            return  Result.failure("查询失败");
        }

    }
}
